Import mojo
Import diddy
Import tween2

Class WrongRight
	Field x:Float
	Field y:Float
	Field alpha:Float
	
	Field wrongImage:GameImage
	Field rightImage:GameImage	
	
	Field isRight:Bool = true
	
	Field fadeTween:Tween2= New Tween2(Tween2.Cubic.EaseInOut,1,0,1000)
	
	Method New()
		wrongImage = game.images.Find("wrong")
		rightImage = game.images.Find("right")		
	End
	
	Method Start:void(x:Int, y:Int, isRight:Bool)
		self.x=x
		self.y=y-20
		self.isRight = isRight
		fadeTween.Start()
	End
	
	Method Update:void()
		fadeTween.Update()
		alpha=fadeTween.Value()
		y-=2
	End
	
	Method Draw:void()
		if (fadeTween.isActive=false)
			return
		End
	
		PushMatrix
	
			SetAlpha(alpha)
			Translate(x,y)
			
			if(isRight)
				rightImage.Draw(0,0)
			else
				wrongImage.Draw(0,0)				
			End
	
			SetAlpha(1)
	
		PopMatrix
	End
End